home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / nkcache / nsICacheSession.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  185 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsICacheSession.idl
  3.  */
  4.  
  5. #ifndef __gen_nsICacheSession_h__
  6. #define __gen_nsICacheSession_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsICache_h__
  14. #include "nsICache.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. class nsICacheEntryDescriptor; /* forward declaration */
  22.  
  23. class nsICacheListener; /* forward declaration */
  24.  
  25.  
  26. /* starting interface:    nsICacheSession */
  27. #define NS_ICACHESESSION_IID_STR "ae9e84b5-3e2d-457e-8fcd-5bbd2a8b832e"
  28.  
  29. #define NS_ICACHESESSION_IID \
  30.   {0xae9e84b5, 0x3e2d, 0x457e, \
  31.     { 0x8f, 0xcd, 0x5b, 0xbd, 0x2a, 0x8b, 0x83, 0x2e }}
  32.  
  33. class NS_NO_VTABLE nsICacheSession : public nsISupports {
  34.  public: 
  35.  
  36.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICACHESESSION_IID)
  37.  
  38.   /**
  39.      * Expired entries will be doomed or evicted if this attribute is set to
  40.      * true.  If false, expired entries will be returned (useful for offline-
  41.      * mode and clients, such as HTTP, that can update the valid lifetime of
  42.      * cached content).  This attribute defaults to true.
  43.      */
  44.   /* attribute PRBool doomEntriesIfExpired; */
  45.   NS_IMETHOD GetDoomEntriesIfExpired(PRBool *aDoomEntriesIfExpired) = 0;
  46.   NS_IMETHOD SetDoomEntriesIfExpired(PRBool aDoomEntriesIfExpired) = 0;
  47.  
  48.   /**
  49.      * A cache session can only give out one descriptor with WRITE access
  50.      * to a given cache entry at a time.  Until the client calls MarkValid on
  51.      * its descriptor, other attempts to open the same cache entry will block.
  52.      */
  53. /**
  54.      * Synchronous cache access.  This returns a unique descriptor each
  55.      * time it is called, even if the same key is specified.  When
  56.      * called by multiple threads for write access, only one writable
  57.      * descriptor will be granted.  If 'blockingMode' is set to false, it will
  58.      * return NS_ERROR_CACHE_WAIT_FOR_VALIDATION rather than block when another
  59.      * descriptor has been given WRITE access but hasn't validated the entry yet.
  60.      */
  61.   /* nsICacheEntryDescriptor openCacheEntry (in ACString key, in nsCacheAccessMode accessRequested, in boolean blockingMode); */
  62.   NS_IMETHOD OpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, PRBool blockingMode, nsICacheEntryDescriptor **_retval) = 0;
  63.  
  64.   /**
  65.      * Asynchronous cache access. Does not block the calling thread.
  66.      * Instead, the listener will be notified when the descriptor is
  67.      * available.
  68.      */
  69.   /* void asyncOpenCacheEntry (in ACString key, in nsCacheAccessMode accessRequested, in nsICacheListener listener); */
  70.   NS_IMETHOD AsyncOpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, nsICacheListener *listener) = 0;
  71.  
  72.   /**
  73.      * Evict all entries for this session's clientID according to its storagePolicy.
  74.      */
  75.   /* void evictEntries (); */
  76.   NS_IMETHOD EvictEntries(void) = 0;
  77.  
  78.   /**
  79.      * Return whether any of the cache devices implied by the session storage policy
  80.      * are currently enabled for instantiation if they don't already exist.
  81.      */
  82.   /* PRBool isStorageEnabled (); */
  83.   NS_IMETHOD IsStorageEnabled(PRBool *_retval) = 0;
  84.  
  85. };
  86.  
  87. /* Use this macro when declaring classes that implement this interface. */
  88. #define NS_DECL_NSICACHESESSION \
  89.   NS_IMETHOD GetDoomEntriesIfExpired(PRBool *aDoomEntriesIfExpired); \
  90.   NS_IMETHOD SetDoomEntriesIfExpired(PRBool aDoomEntriesIfExpired); \
  91.   NS_IMETHOD OpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, PRBool blockingMode, nsICacheEntryDescriptor **_retval); \
  92.   NS_IMETHOD AsyncOpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, nsICacheListener *listener); \
  93.   NS_IMETHOD EvictEntries(void); \
  94.   NS_IMETHOD IsStorageEnabled(PRBool *_retval); 
  95.  
  96. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  97. #define NS_FORWARD_NSICACHESESSION(_to) \
  98.   NS_IMETHOD GetDoomEntriesIfExpired(PRBool *aDoomEntriesIfExpired) { return _to GetDoomEntriesIfExpired(aDoomEntriesIfExpired); } \
  99.   NS_IMETHOD SetDoomEntriesIfExpired(PRBool aDoomEntriesIfExpired) { return _to SetDoomEntriesIfExpired(aDoomEntriesIfExpired); } \
  100.   NS_IMETHOD OpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, PRBool blockingMode, nsICacheEntryDescriptor **_retval) { return _to OpenCacheEntry(key, accessRequested, blockingMode, _retval); } \
  101.   NS_IMETHOD AsyncOpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, nsICacheListener *listener) { return _to AsyncOpenCacheEntry(key, accessRequested, listener); } \
  102.   NS_IMETHOD EvictEntries(void) { return _to EvictEntries(); } \
  103.   NS_IMETHOD IsStorageEnabled(PRBool *_retval) { return _to IsStorageEnabled(_retval); } 
  104.  
  105. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  106. #define NS_FORWARD_SAFE_NSICACHESESSION(_to) \
  107.   NS_IMETHOD GetDoomEntriesIfExpired(PRBool *aDoomEntriesIfExpired) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDoomEntriesIfExpired(aDoomEntriesIfExpired); } \
  108.   NS_IMETHOD SetDoomEntriesIfExpired(PRBool aDoomEntriesIfExpired) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDoomEntriesIfExpired(aDoomEntriesIfExpired); } \
  109.   NS_IMETHOD OpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, PRBool blockingMode, nsICacheEntryDescriptor **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenCacheEntry(key, accessRequested, blockingMode, _retval); } \
  110.   NS_IMETHOD AsyncOpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, nsICacheListener *listener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncOpenCacheEntry(key, accessRequested, listener); } \
  111.   NS_IMETHOD EvictEntries(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->EvictEntries(); } \
  112.   NS_IMETHOD IsStorageEnabled(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsStorageEnabled(_retval); } 
  113.  
  114. #if 0
  115. /* Use the code below as a template for the implementation class for this interface. */
  116.  
  117. /* Header file */
  118. class nsCacheSession : public nsICacheSession
  119. {
  120. public:
  121.   NS_DECL_ISUPPORTS
  122.   NS_DECL_NSICACHESESSION
  123.  
  124.   nsCacheSession();
  125.  
  126. private:
  127.   ~nsCacheSession();
  128.  
  129. protected:
  130.   /* additional members */
  131. };
  132.  
  133. /* Implementation file */
  134. NS_IMPL_ISUPPORTS1(nsCacheSession, nsICacheSession)
  135.  
  136. nsCacheSession::nsCacheSession()
  137. {
  138.   /* member initializers and constructor code */
  139. }
  140.  
  141. nsCacheSession::~nsCacheSession()
  142. {
  143.   /* destructor code */
  144. }
  145.  
  146. /* attribute PRBool doomEntriesIfExpired; */
  147. NS_IMETHODIMP nsCacheSession::GetDoomEntriesIfExpired(PRBool *aDoomEntriesIfExpired)
  148. {
  149.     return NS_ERROR_NOT_IMPLEMENTED;
  150. }
  151. NS_IMETHODIMP nsCacheSession::SetDoomEntriesIfExpired(PRBool aDoomEntriesIfExpired)
  152. {
  153.     return NS_ERROR_NOT_IMPLEMENTED;
  154. }
  155.  
  156. /* nsICacheEntryDescriptor openCacheEntry (in ACString key, in nsCacheAccessMode accessRequested, in boolean blockingMode); */
  157. NS_IMETHODIMP nsCacheSession::OpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, PRBool blockingMode, nsICacheEntryDescriptor **_retval)
  158. {
  159.     return NS_ERROR_NOT_IMPLEMENTED;
  160. }
  161.  
  162. /* void asyncOpenCacheEntry (in ACString key, in nsCacheAccessMode accessRequested, in nsICacheListener listener); */
  163. NS_IMETHODIMP nsCacheSession::AsyncOpenCacheEntry(const nsACString & key, nsCacheAccessMode accessRequested, nsICacheListener *listener)
  164. {
  165.     return NS_ERROR_NOT_IMPLEMENTED;
  166. }
  167.  
  168. /* void evictEntries (); */
  169. NS_IMETHODIMP nsCacheSession::EvictEntries()
  170. {
  171.     return NS_ERROR_NOT_IMPLEMENTED;
  172. }
  173.  
  174. /* PRBool isStorageEnabled (); */
  175. NS_IMETHODIMP nsCacheSession::IsStorageEnabled(PRBool *_retval)
  176. {
  177.     return NS_ERROR_NOT_IMPLEMENTED;
  178. }
  179.  
  180. /* End of implementation class template. */
  181. #endif
  182.  
  183.  
  184. #endif /* __gen_nsICacheSession_h__ */
  185.